import axios from 'axios'

axios.interceptors.response.use(res => {
  return res.data
}, err => {
  return Promise.reject(err)
})

const fetch = (url, params) => {
  return new Promise(resolve => {
    axios.get(url, {
      params: params
    }).then(res => {
      resolve(res)
    })
  })
}
export default fetch
